//package cn.iocoder.yudao.module.vote.calc;
//
//
//import cn.hutool.core.util.StrUtil;
//import org.apache.catalina.core.ApplicationContext;
//import org.redisson.api.RMap;
//import org.redisson.api.RedissonClient;
//import org.springframework.beans.factory.BeanFactory;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.PostConstruct;
//import javax.annotation.Resource;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * @description:
// * @author: moving
// * @date: 2023/3/16 17:19
// */
//@Component
//public class ScopeCalcRegistry{
//
//
//    private static Map<Long,Map<Class<?>,String>> TYPE_EXPRESS = new HashMap<>();
//
//
//    private static Map<String,ScopeCalcHandler> TYPE_ALIAS = new HashMap<>();
//
//
//    @Resource
//    private BeanFactory beanFactory;
//
//    public ScopeCalcRegistry(){
//
//    }
//
//    public String getExpress(Long tenantId,Class<?> clazz){
//        return TYPE_EXPRESS.get(tenantId).get(clazz);
//    }
//
//    public ScopeCalcHandler getCalc(String type){
//        return TYPE_ALIAS.get(type);
//    }
//
//
//    @PostConstruct
//    private void initTestScope(){
//        Map<Class<?>,String> TYPE_ALIASES = new HashMap<>();
//        TYPE_ALIASES.putIfAbsent(TestScopeCalcHandler.class,"{excellent}*100+{qualified}*0.8+{baseQualified}*0.6+{unqualified}*0.4");
//        TYPE_ALIASES.putIfAbsent(ThirdTestScopeCalcHandler.class,"{excellent}*100+{qualified}*0.8+{baseQualified}*0.6+{unqualified}*0.4");
//        TYPE_EXPRESS.put(1L,TYPE_ALIASES);
//
//
//        // 初始化
//        TYPE_ALIAS.put("TestScope",beanFactory.getBean(TestScopeCalcHandler.class));
//        TYPE_ALIAS.put("ThirdTestScope",beanFactory.getBean(ThirdTestScopeCalcHandler.class));
//    }
//
//}
